/**
 * 
 */
package com.shelpe.services.sinbad.service.base;

import java.io.IOException;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.shelpe.services.sinbad.controller.dto.redis.RedisDto;


/**
 * service基类
 * @author louxinhua
 *
 */

public class BaseService {
	@Autowired
	private ObjectMapper objectMapper;

	/**
	 * logger
	 */
	protected final Logger logger = LoggerFactory.getLogger(this.getClass());
	
	
	public RedisDto unserialize(String diff) { // 反序列化，字符串到对象的过程
		try {
			return objectMapper.readerFor(RedisDto.class).readValue(diff);
		} catch (IOException e) {
			e.printStackTrace();
		}
		return null;
	}
	
}
